package ACM;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author way
 * @create 2025-03-21 16:06
 */
public class ScannerTest {
    public static void main(String[] args) {
        //1.数据输入
        Scanner in = new Scanner(System.in);
        //读数字
        int numLen = in.nextInt();
        int[] numArr = new int[numLen];
        int i = 0;
        while (in.hasNextInt() && i < numLen) {
            numArr[i] = in.nextInt();
            i++;
        }
        //读字符串
        int strLen = in.nextInt();
        in.nextLine(); //数字到字符串要换行
        String[] strArr = new String[strLen];
        //或者 strArr[] = in.nextLine().split(" ");
        int j = 0;
        while (in.hasNextLine() && j < strLen) {
            strArr[j] = in.nextLine();
            j++;
        }

        //2. 处理
        Solution solution = new Solution();
        String result = solution.process(numArr, strArr);

        //3. 输出
        System.out.println(result);
        //四舍五入输出小数
        String str = String.format("%.2f", 3.555);
        System.out.println(str);
    }
}

//下面类似 LeetCode 的核心代码模式
class Solution {
    public String process(int[] nums, String[] strs) {
        StringBuilder sb = new StringBuilder();
        sb.append(Arrays.toString(nums));
        sb.append(" && ");
        sb.append(Arrays.toString(strs));
        return sb.toString();
    }
}
